package IO流.Writer;

import org.junit.jupiter.api.Test;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

@SuppressWarnings("all")
public class BufferWritered01 {

    @Test
    public void bufferWriter() throws IOException {
        String filePath = "src/main/java/IO流/Reader/1.txt";
        BufferedWriter bufferedWriter = null;
        try {
            bufferedWriter = new BufferedWriter(new FileWriter(filePath,true));
            bufferedWriter.write("节点流和处理流");
            bufferedWriter.newLine();//插入一个换好符
            bufferedWriter.write("北京欢迎你");
            bufferedWriter.newLine();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            bufferedWriter.close();
        }
    }
}
